words = '精诚所至金石为开'
char_one = words[1]    # 获取索引为1的字符“诚”
char_two = words[-7]   # 获取索引为-7的字符“诚”

print(words[:5])             # 获取从索引0到索引5之前的子串
print(words[5:])             # 获取从索引5到末尾的子串
print(words[4:6])            # 获取从索引4到索引6之前的子串
print(words[::2])            # 获取从索引0到末尾、步长为2的子串
print(words[-4:-2])          # 获取从索引-4到索引-2之前的子串
print(words[-4:6])           # 获取从索引-4到索引6之前的子串

# words[3] = ','